public class YW_DuckSimulator {

	public static void main(String[] args) {
		YW_DuckSimulator simulator = new YW_DuckSimulator();
		simulator.simulate();
	}
 
	void simulate() {
		YW_Quackable yw_MallardDuck =new YW_QuackCounter(new YW_MallardDuck());
		YW_Quackable yw_RedheadDuck = new YW_QuackCounter(new YW_RedheadDuck());
		YW_Quackable yw_DuckCall = new YW_QuackCounter(new YW_DuckCall());
		YW_Quackable yw_RubberDuck = new YW_QuackCounter(new YW_RubberDuck());
		YW_Quackable yw_GooseDuck = new YW_GooseAdapter(new YW_Goose());
		
		System.out.println("\nMy Duck Simulator: With Decorator: Demo3");	
		simulate(yw_MallardDuck);
		simulate(yw_RedheadDuck);
		simulate(yw_DuckCall);
		simulate(yw_RubberDuck);
		simulate(yw_GooseDuck);
		
		System.out.println("The my ducks quacked " + 
               YW_QuackCounter.getQuacks() + " times");
	}

	void simulate(YW_Quackable duck) {
		duck.quack();
	}
}
